﻿using System;
using System.Configuration;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Wordprocessing;

namespace component
{
    class StyleDefinitions
    {
        public static void GenerateStyleDefinitionsPartContent(StyleDefinitionsPart styleDefinitionsPart, string styleName)
        {
            RunPropertiesDefault runPropertiesDefault = new RunPropertiesDefault();
            ParagraphPropertiesDefault paragraphPropertiesDefault = new ParagraphPropertiesDefault();

            StyleTableProperties styleTablePropertiesCode = new StyleTableProperties();
            StyleTableCellProperties styleTableCellPropertiesCode = new StyleTableCellProperties();

            StyleTableProperties styleTablePropertiesAlert = new StyleTableProperties();
            StyleTableCellProperties styleTableCellPropertiesAlert = new StyleTableCellProperties();

            StyleTableProperties styleTablePropertiesQuote = new StyleTableProperties();
            StyleTableCellProperties styleTableCellPropertiesQuote = new StyleTableCellProperties();

            StyleParagraphProperties styleParagraphPropertiesNameTopic = new StyleParagraphProperties();
            StyleRunProperties styleRunPropertiesNameTopic = new StyleRunProperties();

            StyleParagraphProperties styleParagraphPropertiesTitle = new StyleParagraphProperties();
            StyleRunProperties styleRunPropertiesTitle = new StyleRunProperties();

            StyleParagraphProperties styleParagraphPropertiesGlossaryTerm = new StyleParagraphProperties();
            StyleRunProperties styleRunPropertiesGlossaryTerm = new StyleRunProperties();

            switch (styleName)
            {
                case "modern":
                    {
                        //Настраиваем стиль по умолчанию
                        RunPropertiesBaseStyle runPropertiesBaseStyle = new RunPropertiesBaseStyle();
                        RunFonts runFonts = new RunFonts() { AsciiTheme = ThemeFontValues.MinorHighAnsi, HighAnsiTheme = ThemeFontValues.MinorHighAnsi, EastAsiaTheme = ThemeFontValues.MinorEastAsia, ComplexScriptTheme = ThemeFontValues.MinorBidi };
                        FontSize fontSize = new FontSize() { Val = "24" };
                        FontSizeComplexScript fontSizeComplexScript = new FontSizeComplexScript() { Val = "22" };
                        Languages languages = new Languages() { Val = "ru-RU", EastAsia = "en-US", Bidi = "ar-SA" };

                        runPropertiesBaseStyle.Append(runFonts);
                        runPropertiesBaseStyle.Append(fontSize);
                        runPropertiesBaseStyle.Append(fontSizeComplexScript);
                        runPropertiesBaseStyle.Append(languages);

                        runPropertiesDefault.Append(runPropertiesBaseStyle);

                        ParagraphPropertiesBaseStyle paragraphPropertiesBaseStyle = new ParagraphPropertiesBaseStyle();
                        SpacingBetweenLines spacingBetweenLines = new SpacingBetweenLines() { After = "100", Line = "267" };
                        paragraphPropertiesBaseStyle.Append(spacingBetweenLines);
                        paragraphPropertiesDefault.Append(paragraphPropertiesBaseStyle);
                        //-----------------------------------------------------------------------------------------


                        //Настраиваем стиль для Code
                        TableBorders tableBordersCode = new TableBorders();
                        TopBorder topBorderCode = new TopBorder() { Val = BorderValues.Single, Color = "4F81BD", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
                        LeftBorder leftBorderCode = new LeftBorder() { Val = BorderValues.Single, Color = "4F81BD", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
                        BottomBorder bottomBorderCode = new BottomBorder() { Val = BorderValues.Single, Color = "4F81BD", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
                        RightBorder rightBorderCode = new RightBorder() { Val = BorderValues.Single, Color = "4F81BD", Size = (UInt32Value)4U, Space = (UInt32Value)0U };

                        tableBordersCode.Append(topBorderCode);
                        tableBordersCode.Append(leftBorderCode);
                        tableBordersCode.Append(bottomBorderCode);
                        tableBordersCode.Append(rightBorderCode);

                        TableCellMarginDefault tableCellMarginDefaultCode = new TableCellMarginDefault();
                        TopMargin topMarginCode = new TopMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellLeftMargin tableCellLeftMarginCode = new TableCellLeftMargin() { Width = 100, Type = TableWidthValues.Dxa };
                        BottomMargin bottomMarginCode = new BottomMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellRightMargin tableCellRightMarginCode = new TableCellRightMargin() { Width = 100, Type = TableWidthValues.Dxa };

                        tableCellMarginDefaultCode.Append(topMarginCode);
                        tableCellMarginDefaultCode.Append(tableCellLeftMarginCode);
                        tableCellMarginDefaultCode.Append(bottomMarginCode);
                        tableCellMarginDefaultCode.Append(tableCellRightMarginCode);

                        styleTablePropertiesCode.Append(tableBordersCode);
                        styleTablePropertiesCode.Append(tableCellMarginDefaultCode);

                        Shading shadingCode = new Shading() { Val = ShadingPatternValues.Clear, Color = "auto", Fill = "DCE6F2" };
                        styleTableCellPropertiesCode.Append(shadingCode);
                        //-----------------------------------------------------------------------------------------


                        //Настраиваем стиль для Alert
                        TableBorders tableBordersAlert = new TableBorders();
                        TopBorder topBorderAlert = new TopBorder() { Val = BorderValues.Single, Color = "FF0000", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
                        LeftBorder leftBorderAlert = new LeftBorder() { Val = BorderValues.Single, Color = "FF0000", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
                        BottomBorder bottomBorderAlert = new BottomBorder() { Val = BorderValues.Single, Color = "FF0000", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
                        RightBorder rightBorderAlert = new RightBorder() { Val = BorderValues.Single, Color = "FF0000", Size = (UInt32Value)4U, Space = (UInt32Value)0U };

                        tableBordersAlert.Append(topBorderAlert);
                        tableBordersAlert.Append(leftBorderAlert);
                        tableBordersAlert.Append(bottomBorderAlert);
                        tableBordersAlert.Append(rightBorderAlert);

                        TableCellMarginDefault tableCellMarginDefaultAlert = new TableCellMarginDefault();
                        TopMargin topMarginAlert = new TopMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellLeftMargin tableCellLeftMarginAlert = new TableCellLeftMargin() { Width = 100, Type = TableWidthValues.Dxa };
                        BottomMargin bottomMarginAlert = new BottomMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellRightMargin tableCellRightMarginAlert = new TableCellRightMargin() { Width = 100, Type = TableWidthValues.Dxa };

                        tableCellMarginDefaultAlert.Append(topMarginAlert);
                        tableCellMarginDefaultAlert.Append(tableCellLeftMarginAlert);
                        tableCellMarginDefaultAlert.Append(bottomMarginAlert);
                        tableCellMarginDefaultAlert.Append(tableCellRightMarginAlert);

                        styleTablePropertiesAlert.Append(tableBordersAlert);
                        styleTablePropertiesAlert.Append(tableCellMarginDefaultAlert);

                        Shading shadingAlert = new Shading() { Val = ShadingPatternValues.Clear, Color = "auto", Fill = "FDEADA" };
                        styleTableCellPropertiesAlert.Append(shadingAlert);
                        //------------------------------------------------------------------------------------------------------------


                        //Настраиваем стиль для Quote
                        TableBorders tableBordersQuote = new TableBorders();
                        TopBorder topBorderQuote = new TopBorder() { Val = BorderValues.Single, Color = "000000", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
                        LeftBorder leftBorderQuote = new LeftBorder() { Val = BorderValues.Single, Color = "000000", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
                        BottomBorder bottomBorderQuote = new BottomBorder() { Val = BorderValues.Single, Color = "000000", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
                        RightBorder rightBorderQuote = new RightBorder() { Val = BorderValues.Single, Color = "000000", Size = (UInt32Value)4U, Space = (UInt32Value)0U };

                        tableBordersQuote.Append(topBorderQuote);
                        tableBordersQuote.Append(leftBorderQuote);
                        tableBordersQuote.Append(bottomBorderQuote);
                        tableBordersQuote.Append(rightBorderQuote);

                        TableCellMarginDefault tableCellMarginDefaultQuote = new TableCellMarginDefault();
                        TopMargin topMarginQuote = new TopMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellLeftMargin tableCellLeftMarginQuote = new TableCellLeftMargin() { Width = 100, Type = TableWidthValues.Dxa };
                        BottomMargin bottomMarginQuote = new BottomMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellRightMargin tableCellRightMarginQuote = new TableCellRightMargin() { Width = 100, Type = TableWidthValues.Dxa };

                        tableCellMarginDefaultQuote.Append(topMarginQuote);
                        tableCellMarginDefaultQuote.Append(tableCellLeftMarginQuote);
                        tableCellMarginDefaultQuote.Append(bottomMarginQuote);
                        tableCellMarginDefaultQuote.Append(tableCellRightMarginQuote);

                        styleTablePropertiesQuote.Append(tableBordersQuote);
                        styleTablePropertiesQuote.Append(tableCellMarginDefaultQuote);

                        Shading shadingQuote = new Shading() { Val = ShadingPatternValues.Clear, Color = "auto", Fill = "D9D9D9" };
                        styleTableCellPropertiesQuote.Append(shadingQuote);
                        //------------------------------------------------------------------------------------------------------------


                        //Настараиваем стиль для названия топика
                        SpacingBetweenLines spacingBetweenLinesNameTopic = new SpacingBetweenLines() { Before = "480", After = "50" };

                        styleParagraphPropertiesNameTopic.Append(spacingBetweenLinesNameTopic);

                        RunFonts runFontsNameTopic = new RunFonts() { AsciiTheme = ThemeFontValues.MajorHighAnsi, HighAnsiTheme = ThemeFontValues.MajorHighAnsi, EastAsiaTheme = ThemeFontValues.MajorEastAsia, ComplexScriptTheme = ThemeFontValues.MajorBidi };
                        Bold boldNameTopic = new Bold();
                        BoldComplexScript boldComplexScriptNameTopic = new BoldComplexScript();
                        Color colorNameTopic = new Color() { Val = "376092" };
                        FontSize fontSizeNameTopic = new FontSize() { Val = "28" };
                        FontSizeComplexScript fontSizeComplexScriptNameTopic = new FontSizeComplexScript() { Val = "28" };

                        styleRunPropertiesNameTopic.Append(runFontsNameTopic);
                        styleRunPropertiesNameTopic.Append(boldNameTopic);
                        styleRunPropertiesNameTopic.Append(boldComplexScriptNameTopic);
                        styleRunPropertiesNameTopic.Append(colorNameTopic);
                        styleRunPropertiesNameTopic.Append(fontSizeNameTopic);
                        styleRunPropertiesNameTopic.Append(fontSizeComplexScriptNameTopic);
                        //------------------------------------------------------------------------------------------------------------


                        //Настраиваем стиль для title
                        SpacingBetweenLines spacingBetweenLinesTitle = new SpacingBetweenLines() { Before = "200", After = "50" };

                        styleParagraphPropertiesTitle.Append(spacingBetweenLinesTitle);

                        RunFonts runFontsTitle = new RunFonts() { AsciiTheme = ThemeFontValues.MajorHighAnsi, HighAnsiTheme = ThemeFontValues.MajorHighAnsi, EastAsiaTheme = ThemeFontValues.MajorEastAsia, ComplexScriptTheme = ThemeFontValues.MajorBidi };
                        Bold boldTitle = new Bold();
                        BoldComplexScript boldComplexScriptTitle = new BoldComplexScript();
                        Color colorTitle = new Color() { Val = "4F81BD" };
                        FontSize fontSizeTitle = new FontSize() { Val = "26" };
                        FontSizeComplexScript fontSizeComplexScriptTitle = new FontSizeComplexScript() { Val = "26" };

                        styleRunPropertiesTitle.Append(runFontsTitle);
                        styleRunPropertiesTitle.Append(boldTitle);
                        styleRunPropertiesTitle.Append(boldComplexScriptTitle);
                        styleRunPropertiesTitle.Append(colorTitle);
                        styleRunPropertiesTitle.Append(fontSizeTitle);
                        styleRunPropertiesTitle.Append(fontSizeComplexScriptTitle);
                        //------------------------------------------------------------------------------------------------------------


                        //Настраиваем стиль для glossaryTerm
                        Shading shadingGlossaryTerm = new Shading() { Val = ShadingPatternValues.Clear, Color = "auto", Fill = "DBEEF4" };
                        SpacingBetweenLines spacingBetweenLinesGlossaryTerm = new SpacingBetweenLines() { Before = "150", After = "70" };

                        styleParagraphPropertiesGlossaryTerm.Append(shadingGlossaryTerm);
                        styleParagraphPropertiesGlossaryTerm.Append(spacingBetweenLinesGlossaryTerm);

                        Bold boldNameGlossaryTerm = new Bold();
                        BoldComplexScript boldComplexScriptNameGlossaryTerm = new BoldComplexScript();
                        Color colorNameGlossaryTerm = new Color() { Val = "576592" };
                        FontSize fontSizeGlossaryTerm = new FontSize() { Val = "20" };
                        FontSizeComplexScript fontSizeComplexScriptGlossaryTerm = new FontSizeComplexScript() { Val = "20" };

                        styleRunPropertiesGlossaryTerm.Append(boldNameGlossaryTerm);
                        styleRunPropertiesGlossaryTerm.Append(boldComplexScriptNameGlossaryTerm);
                        styleRunPropertiesGlossaryTerm.Append(colorNameGlossaryTerm);
                        styleRunPropertiesGlossaryTerm.Append(fontSizeGlossaryTerm);
                        styleRunPropertiesGlossaryTerm.Append(fontSizeComplexScriptGlossaryTerm);
                        //------------------------------------------------------------------------------------------------------------
                    }
                    break;
                case "simple":
                    {
                        //Настраиваем стиль по умолчанию
                        RunPropertiesBaseStyle runPropertiesBaseStyle = new RunPropertiesBaseStyle();
                        RunFonts runFonts = new RunFonts() { ComplexScript = "Times New Roman", AsciiTheme = ThemeFontValues.MinorHighAnsi, HighAnsiTheme = ThemeFontValues.MinorHighAnsi, EastAsiaTheme = ThemeFontValues.MinorEastAsia };
                        FontSize fontSize = new FontSize() { Val = "24" };
                        FontSizeComplexScript fontSizeComplexScript = new FontSizeComplexScript() { Val = "22" };
                        Languages languages = new Languages() { Val = "ru-RU", EastAsia = "en-US", Bidi = "ar-SA" };

                        runPropertiesBaseStyle.Append(runFonts);
                        runPropertiesBaseStyle.Append(fontSize);
                        runPropertiesBaseStyle.Append(fontSizeComplexScript);
                        runPropertiesBaseStyle.Append(languages);

                        runPropertiesDefault.Append(runPropertiesBaseStyle);

                        ParagraphPropertiesBaseStyle paragraphPropertiesBaseStyle = new ParagraphPropertiesBaseStyle();
                        SpacingBetweenLines spacingBetweenLines = new SpacingBetweenLines() { After = "100", Line = "267" };
                        paragraphPropertiesBaseStyle.Append(spacingBetweenLines);
                        paragraphPropertiesDefault.Append(paragraphPropertiesBaseStyle);
                        //-----------------------------------------------------------------------------------------


                        //Настраиваем стиль для Code
                        TableCellMarginDefault tableCellMarginDefaultCode = new TableCellMarginDefault();
                        TopMargin topMarginCode = new TopMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellLeftMargin tableCellLeftMarginCode = new TableCellLeftMargin() { Width = 100, Type = TableWidthValues.Dxa };
                        BottomMargin bottomMarginCode = new BottomMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellRightMargin tableCellRightMarginCode = new TableCellRightMargin() { Width = 100, Type = TableWidthValues.Dxa };

                        tableCellMarginDefaultCode.Append(topMarginCode);
                        tableCellMarginDefaultCode.Append(tableCellLeftMarginCode);
                        tableCellMarginDefaultCode.Append(bottomMarginCode);
                        tableCellMarginDefaultCode.Append(tableCellRightMarginCode);

                        styleTablePropertiesCode.Append(tableCellMarginDefaultCode);

                        Shading shadingCode = new Shading() { Val = ShadingPatternValues.Clear, Color = "auto", Fill = "DBEEF4" };

                        RunProperties runPropertiesCode = new RunProperties();
                        RunFonts runFontsCode = new RunFonts() { Ascii = "Courier New", HighAnsi = "Courier New", ComplexScript = "Courier New" };
                        FontSize fontSizeCode = new FontSize() { Val = "18" };
                        FontSizeComplexScript fontSizeComplexScriptCode = new FontSizeComplexScript() { Val = "18" };
                        runPropertiesCode.Append(runFontsCode);
                        runPropertiesCode.Append(fontSizeCode);
                        runPropertiesCode.Append(fontSizeComplexScriptCode);

                        styleTableCellPropertiesCode.Append(shadingCode);
                        styleTableCellPropertiesCode.Append(runPropertiesCode);
                        //-----------------------------------------------------------------------------------------


                        //Настраиваем стиль для Alert
                        TableCellMarginDefault tableCellMarginDefaultAlert = new TableCellMarginDefault();
                        TopMargin topMarginAlert = new TopMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellLeftMargin tableCellLeftMarginAlert = new TableCellLeftMargin() { Width = 100, Type = TableWidthValues.Dxa };
                        BottomMargin bottomMarginAlert = new BottomMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellRightMargin tableCellRightMarginAlert = new TableCellRightMargin() { Width = 100, Type = TableWidthValues.Dxa };

                        tableCellMarginDefaultAlert.Append(topMarginAlert);
                        tableCellMarginDefaultAlert.Append(tableCellLeftMarginAlert);
                        tableCellMarginDefaultAlert.Append(bottomMarginAlert);
                        tableCellMarginDefaultAlert.Append(tableCellRightMarginAlert);

                        styleTablePropertiesAlert.Append(tableCellMarginDefaultAlert);

                        Shading shadingAlert = new Shading() { Val = ShadingPatternValues.Clear, Color = "auto", Fill = "E6B9B8" };

                        ParagraphProperties paragraphPropertiesAlert = new ParagraphProperties();
                        Justification justificationAlert = new Justification() { Val = JustificationValues.Both };
                        paragraphPropertiesAlert.Append(justificationAlert);

                        RunProperties runPropertiesAlert = new RunProperties();
                        RunFonts runFontsAlert = new RunFonts() { Ascii = "Arial Unicode MS", HighAnsi = "Arial Unicode MS", EastAsia = "Arial Unicode MS", ComplexScript = "Arial Unicode MS" };
                        FontSize fontSizeAlert = new FontSize() { Val = "18" };
                        FontSizeComplexScript fontSizeComplexScriptAlert = new FontSizeComplexScript() { Val = "18" };
                        runPropertiesAlert.Append(runFontsAlert);
                        runPropertiesAlert.Append(fontSizeAlert);
                        runPropertiesAlert.Append(fontSizeComplexScriptAlert);

                        styleTableCellPropertiesAlert.Append(shadingAlert);
                        styleTableCellPropertiesAlert.Append(paragraphPropertiesAlert);
                        styleTableCellPropertiesAlert.Append(runPropertiesAlert);
                        //------------------------------------------------------------------------------------------------------------


                        //Настраиваем стиль для Quote
                        TableCellMarginDefault tableCellMarginDefaultQuote = new TableCellMarginDefault();
                        TopMargin topMarginQuote = new TopMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellLeftMargin tableCellLeftMarginQuote = new TableCellLeftMargin() { Width = 100, Type = TableWidthValues.Dxa };
                        BottomMargin bottomMarginQuote = new BottomMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellRightMargin tableCellRightMarginQuote = new TableCellRightMargin() { Width = 100, Type = TableWidthValues.Dxa };

                        tableCellMarginDefaultQuote.Append(topMarginQuote);
                        tableCellMarginDefaultQuote.Append(tableCellLeftMarginQuote);
                        tableCellMarginDefaultQuote.Append(bottomMarginQuote);
                        tableCellMarginDefaultQuote.Append(tableCellRightMarginQuote);

                        styleTablePropertiesQuote.Append(tableCellMarginDefaultQuote);

                        Shading shadingQuote = new Shading() { Val = ShadingPatternValues.Clear, Color = "auto", Fill = "FFFFCC" };

                        RunProperties runPropertiesQuote = new RunProperties();
                        RunFonts runFontsQuote = new RunFonts() { Ascii = "Times New Roman", HighAnsi = "Times New Roman", EastAsia = "Arial Unicode MS", ComplexScript = "Times New Roman" };
                        Italic italicQuote = new Italic();
                        FontSize fontSizeQuote = new FontSize() { Val = "18" };
                        FontSizeComplexScript fontSizeComplexScriptQuote = new FontSizeComplexScript() { Val = "18" };
                        runPropertiesQuote.Append(runFontsQuote);
                        runPropertiesQuote.Append(italicQuote);
                        runPropertiesQuote.Append(fontSizeQuote);
                        runPropertiesQuote.Append(fontSizeComplexScriptQuote);

                        styleTableCellPropertiesQuote.Append(shadingQuote);
                        //------------------------------------------------------------------------------------------------------------


                        //Настараиваем стиль для названия топика
                        SpacingBetweenLines spacingBetweenLinesNameTopic = new SpacingBetweenLines() { Before = "400", After = "50" };

                        styleParagraphPropertiesNameTopic.Append(spacingBetweenLinesNameTopic);

                        RunFonts runFontsNameTopic = new RunFonts() { AsciiTheme = ThemeFontValues.MajorHighAnsi, HighAnsiTheme = ThemeFontValues.MajorHighAnsi, EastAsiaTheme = ThemeFontValues.MajorEastAsia };
                        Bold boldNameTopic = new Bold();
                        BoldComplexScript boldComplexScriptNameTopic = new BoldComplexScript();
                        //Color colorNameTopic = new Color() { Val = "7030A0" };
                        FontSize fontSizeNameTopic = new FontSize() { Val = "28" };
                        FontSizeComplexScript fontSizeComplexScriptNameTopic = new FontSizeComplexScript() { Val = "28" };

                        styleRunPropertiesNameTopic.Append(runFontsNameTopic);
                        styleRunPropertiesNameTopic.Append(boldNameTopic);
                        styleRunPropertiesNameTopic.Append(boldComplexScriptNameTopic);
                        //styleRunPropertiesNameTopic.Append(colorNameTopic);
                        styleRunPropertiesNameTopic.Append(fontSizeNameTopic);
                        styleRunPropertiesNameTopic.Append(fontSizeComplexScriptNameTopic);
                        //------------------------------------------------------------------------------------------------------------


                        //Настраиваем стиль для title
                        SpacingBetweenLines spacingBetweenLinesTitle = new SpacingBetweenLines() { Before = "200", After = "50" };

                        styleParagraphPropertiesTitle.Append(spacingBetweenLinesTitle);

                        RunFonts runFontsTitle = new RunFonts() { AsciiTheme = ThemeFontValues.MajorHighAnsi, HighAnsiTheme = ThemeFontValues.MajorHighAnsi, EastAsiaTheme = ThemeFontValues.MajorEastAsia };
                        Bold boldTitle = new Bold();
                        BoldComplexScript boldComplexScriptTitle = new BoldComplexScript();
                        Color colorTitle = new Color() { Val = "666666" };
                        FontSize fontSizeTitle = new FontSize() { Val = "26" };
                        FontSizeComplexScript fontSizeComplexScriptTitle = new FontSizeComplexScript() { Val = "26" };

                        styleRunPropertiesTitle.Append(runFontsTitle);
                        styleRunPropertiesTitle.Append(boldTitle);
                        styleRunPropertiesTitle.Append(boldComplexScriptTitle);
                        styleRunPropertiesTitle.Append(colorTitle);
                        styleRunPropertiesTitle.Append(fontSizeTitle);
                        styleRunPropertiesTitle.Append(fontSizeComplexScriptTitle);
                        //------------------------------------------------------------------------------------------------------------


                        //Настраиваем стиль для glossaryTerm
                        Shading shadingGlossaryTerm = new Shading() { Val = ShadingPatternValues.Clear, Color = "auto", Fill = "D9D9D9" };
                        SpacingBetweenLines spacingBetweenLinesGlossaryTerm = new SpacingBetweenLines() { Before = "150", After = "70" };

                        styleParagraphPropertiesGlossaryTerm.Append(shadingGlossaryTerm);
                        styleParagraphPropertiesGlossaryTerm.Append(spacingBetweenLinesGlossaryTerm);

                        Bold boldNameGlossaryTerm = new Bold();
                        BoldComplexScript boldComplexScriptNameGlossaryTerm = new BoldComplexScript();
                        Color colorNameGlossaryTerm = new Color() { Val = "000000" };
                        FontSize fontSizeGlossaryTerm = new FontSize() { Val = "20" };
                        FontSizeComplexScript fontSizeComplexScriptGlossaryTerm = new FontSizeComplexScript() { Val = "20" };

                        styleRunPropertiesGlossaryTerm.Append(boldNameGlossaryTerm);
                        styleRunPropertiesGlossaryTerm.Append(boldComplexScriptNameGlossaryTerm);
                        styleRunPropertiesGlossaryTerm.Append(colorNameGlossaryTerm);
                        styleRunPropertiesGlossaryTerm.Append(fontSizeGlossaryTerm);
                        styleRunPropertiesGlossaryTerm.Append(fontSizeComplexScriptGlossaryTerm);
                        //------------------------------------------------------------------------------------------------------------
                    }
                    break;

                case "strong":
                    {
                        //Настраиваем стиль по умолчанию
                        RunPropertiesBaseStyle runPropertiesBaseStyle = new RunPropertiesBaseStyle();
                        RunFonts runFonts = new RunFonts() { Ascii = "Times New Roman", HighAnsi = "Times New Roman", EastAsia = "Arial Unicode MS", ComplexScript = "Times New Roman" };
                        FontSize fontSize = new FontSize() { Val = "24" };
                        FontSizeComplexScript fontSizeComplexScript = new FontSizeComplexScript() { Val = "22" };
                        Languages languages = new Languages() { Val = "ru-RU", EastAsia = "en-US", Bidi = "ar-SA" };

                        runPropertiesBaseStyle.Append(runFonts);
                        runPropertiesBaseStyle.Append(fontSize);
                        runPropertiesBaseStyle.Append(fontSizeComplexScript);
                        runPropertiesBaseStyle.Append(languages);

                        runPropertiesDefault.Append(runPropertiesBaseStyle);

                        ParagraphPropertiesBaseStyle paragraphPropertiesBaseStyle = new ParagraphPropertiesBaseStyle();
                        SpacingBetweenLines spacingBetweenLines = new SpacingBetweenLines() { Line = "360" };
                        Indentation indentation = new Indentation() { FirstLine = "443" };
                        paragraphPropertiesBaseStyle.Append(spacingBetweenLines);
                        paragraphPropertiesBaseStyle.Append(indentation);
                        paragraphPropertiesDefault.Append(paragraphPropertiesBaseStyle);
                        //-----------------------------------------------------------------------------------------


                        //Настраиваем стиль для Code
                        TableCellMarginDefault tableCellMarginDefaultCode = new TableCellMarginDefault();
                        TopMargin topMarginCode = new TopMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellLeftMargin tableCellLeftMarginCode = new TableCellLeftMargin() { Width = 100, Type = TableWidthValues.Dxa };
                        BottomMargin bottomMarginCode = new BottomMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellRightMargin tableCellRightMarginCode = new TableCellRightMargin() { Width = 100, Type = TableWidthValues.Dxa };

                        tableCellMarginDefaultCode.Append(topMarginCode);
                        tableCellMarginDefaultCode.Append(tableCellLeftMarginCode);
                        tableCellMarginDefaultCode.Append(bottomMarginCode);
                        tableCellMarginDefaultCode.Append(tableCellRightMarginCode);

                        styleTablePropertiesCode.Append(tableCellMarginDefaultCode);

                        RunProperties runPropertiesCode = new RunProperties();
                        RunFonts runFontsCode = new RunFonts() { Ascii = "Courier New", HighAnsi = "Courier New", ComplexScript = "Courier New" };
                        FontSize fontSizeCode = new FontSize() { Val = "16" };
                        FontSizeComplexScript fontSizeComplexScriptCode = new FontSizeComplexScript() { Val = "16" };
                        runPropertiesCode.Append(runFontsCode);
                        runPropertiesCode.Append(fontSizeCode);
                        runPropertiesCode.Append(fontSizeComplexScriptCode);

                        styleTableCellPropertiesCode.Append(runPropertiesCode);
                        //-----------------------------------------------------------------------------------------


                        //Настараиваем стиль для названия топика
                        ParagraphBorders paragraphBordersNameTopic = new ParagraphBorders();
                        BottomBorder bottomBorderNameTopic = new BottomBorder() { Val = BorderValues.ThinThickSmallGap, Color = "953735", Size = (UInt32Value)12U, Space = (UInt32Value)1U };
                        paragraphBordersNameTopic.Append(bottomBorderNameTopic);
                        Justification justificationNameTopic = new Justification() { Val = JustificationValues.Center };
                        styleParagraphPropertiesNameTopic.Append(paragraphBordersNameTopic);
                        styleParagraphPropertiesNameTopic.Append(justificationNameTopic);

                        Color colorNameTopic = new Color() { Val = "632523" };
                        FontSize fontSizeNameTopic = new FontSize() { Val = "28" };
                        FontSizeComplexScript fontSizeComplexScriptNameTopic = new FontSizeComplexScript() { Val = "28" };

                        styleRunPropertiesNameTopic.Append(colorNameTopic);
                        styleRunPropertiesNameTopic.Append(fontSizeNameTopic);
                        styleRunPropertiesNameTopic.Append(fontSizeComplexScriptNameTopic);
                        //------------------------------------------------------------------------------------------------------------


                        //Настраиваем стиль для title
                        ParagraphBorders paragraphBordersTitle = new ParagraphBorders();
                        BottomBorder bottomBorderTitle = new BottomBorder() { Val = BorderValues.Single, Color = "632523", Size = (UInt32Value)4U, Space = (UInt32Value)1U };
                        paragraphBordersTitle.Append(bottomBorderTitle);
                        Justification justificationTitle = new Justification() { Val = JustificationValues.Center };
                        styleParagraphPropertiesTitle.Append(paragraphBordersTitle);
                        styleParagraphPropertiesTitle.Append(justificationTitle);

                        SpacingBetweenLines spacingBetweenLinesTitle = new SpacingBetweenLines() { Before = "200", After = "50" };

                        styleParagraphPropertiesTitle.Append(spacingBetweenLinesTitle);

                        Color colorTitle = new Color() { Val = "632523" };
                        FontSize fontSizeTitle = new FontSize() { Val = "26" };
                        FontSizeComplexScript fontSizeComplexScriptTitle = new FontSizeComplexScript() { Val = "26" };

                        styleRunPropertiesTitle.Append(colorTitle);
                        styleRunPropertiesTitle.Append(fontSizeTitle);
                        styleRunPropertiesTitle.Append(fontSizeComplexScriptTitle);
                        //------------------------------------------------------------------------------------------------------------


                        //Настраиваем стиль для glossaryTerm
                        Shading shadingGlossaryTerm = new Shading() { Val = ShadingPatternValues.Clear, Color = "auto", Fill = "CCCCFF" };
                        SpacingBetweenLines spacingBetweenLinesGlossaryTerm = new SpacingBetweenLines() { Before = "150", After = "70" };

                        styleParagraphPropertiesGlossaryTerm.Append(shadingGlossaryTerm);
                        styleParagraphPropertiesGlossaryTerm.Append(spacingBetweenLinesGlossaryTerm);

                        Bold boldNameGlossaryTerm = new Bold();
                        BoldComplexScript boldComplexScriptNameGlossaryTerm = new BoldComplexScript();
                        Color colorNameGlossaryTerm = new Color() { Val = "632523" };
                        FontSize fontSizeGlossaryTerm = new FontSize() { Val = "20" };
                        FontSizeComplexScript fontSizeComplexScriptGlossaryTerm = new FontSizeComplexScript() { Val = "20" };

                        styleRunPropertiesGlossaryTerm.Append(boldNameGlossaryTerm);
                        styleRunPropertiesGlossaryTerm.Append(boldComplexScriptNameGlossaryTerm);
                        styleRunPropertiesGlossaryTerm.Append(colorNameGlossaryTerm);
                        styleRunPropertiesGlossaryTerm.Append(fontSizeGlossaryTerm);
                        styleRunPropertiesGlossaryTerm.Append(fontSizeComplexScriptGlossaryTerm);
                        //------------------------------------------------------------------------------------------------------------


                        //Настраиваем стиль для Alert
                        TableBorders tableBordersAlert = new TableBorders();
                        TopBorder topBorderAlert = new TopBorder() { Val = BorderValues.Single, Color = "FF0000", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
                        LeftBorder leftBorderAlert = new LeftBorder() { Val = BorderValues.Single, Color = "FF0000", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
                        BottomBorder bottomBorderAlert = new BottomBorder() { Val = BorderValues.Single, Color = "FF0000", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
                        RightBorder rightBorderAlert = new RightBorder() { Val = BorderValues.Single, Color = "FF0000", Size = (UInt32Value)4U, Space = (UInt32Value)0U };

                        tableBordersAlert.Append(topBorderAlert);
                        tableBordersAlert.Append(leftBorderAlert);
                        tableBordersAlert.Append(bottomBorderAlert);
                        tableBordersAlert.Append(rightBorderAlert);

                        TableCellMarginDefault tableCellMarginDefaultAlert = new TableCellMarginDefault();
                        TopMargin topMarginAlert = new TopMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellLeftMargin tableCellLeftMarginAlert = new TableCellLeftMargin() { Width = 100, Type = TableWidthValues.Dxa };
                        BottomMargin bottomMarginAlert = new BottomMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
                        TableCellRightMargin tableCellRightMarginAlert = new TableCellRightMargin() { Width = 100, Type = TableWidthValues.Dxa };

                        tableCellMarginDefaultAlert.Append(topMarginAlert);
                        tableCellMarginDefaultAlert.Append(tableCellLeftMarginAlert);
                        tableCellMarginDefaultAlert.Append(bottomMarginAlert);
                        tableCellMarginDefaultAlert.Append(tableCellRightMarginAlert);

                        styleTablePropertiesAlert.Append(tableBordersAlert);
                        styleTablePropertiesAlert.Append(tableCellMarginDefaultAlert);
                        //------------------------------------------------------------------------------------------------------------
                    }
                    break;
                default:
                    {
                    }
                    break;
            }
            Styles styles = new Styles();

            //--------------------Определение стиля по умолчанию------------------------
            DocDefaults docDefaults = new DocDefaults();

            docDefaults.Append(runPropertiesDefault);
            docDefaults.Append(paragraphPropertiesDefault);
            //--------------------------------------------------------------------------


            //--------------------Определение стиля для элемета Code--------------------
            Style styleCode = new Style() { Type = StyleValues.Table, StyleId = "Code" };
            StyleName styleNameCode = new StyleName() { Val = "Code" };

            styleCode.Append(styleNameCode);
            styleCode.Append(styleTablePropertiesCode);
            styleCode.Append(styleTableCellPropertiesCode);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемета glossaryTerm--------------------
            Style styleGlossaryTerm = new Style() { Type = StyleValues.Paragraph, StyleId = "GlossaryTerm" };
            StyleName styleNameGlossaryTerm = new StyleName() { Val = "GlossaryTerm" };

            styleGlossaryTerm.Append(styleNameGlossaryTerm);
            styleGlossaryTerm.Append(styleParagraphPropertiesGlossaryTerm);
            styleGlossaryTerm.Append(styleRunPropertiesGlossaryTerm);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемета Alert--------------------
            Style styleAlert = new Style() { Type = StyleValues.Table, StyleId = "Alert" };
            StyleName styleNameAlert = new StyleName() { Val = "Alert" };

            styleAlert.Append(styleNameAlert);
            styleAlert.Append(styleTablePropertiesAlert);
            styleAlert.Append(styleTableCellPropertiesAlert);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемета Quote--------------------
            Style styleQuote = new Style() { Type = StyleValues.Table, StyleId = "Quote" };
            StyleName styleNameQuote = new StyleName() { Val = "Quote" };

            styleQuote.Append(styleNameQuote);
            styleQuote.Append(styleTablePropertiesQuote);
            styleQuote.Append(styleTableCellPropertiesQuote);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для названия топика--------------------
            Style styleNameTopic = new Style() { Type = StyleValues.Paragraph, StyleId = "NameTopic" };
            StyleName styleNameNameTopic = new StyleName() { Val = "NameTopic" };

            styleNameTopic.Append(styleNameNameTopic);
            styleNameTopic.Append(styleParagraphPropertiesNameTopic);
            styleNameTopic.Append(styleRunPropertiesNameTopic);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента title--------------------
            Style styleTitle = new Style() { Type = StyleValues.Paragraph, StyleId = "Title" };
            StyleName styleNameTitle = new StyleName() { Val = "Title" };

            styleTitle.Append(styleNameTitle);
            styleTitle.Append(styleParagraphPropertiesTitle);
            styleTitle.Append(styleRunPropertiesTitle);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента token--------------------
            Style styleToken = new Style() { Type = StyleValues.Character, StyleId = "Token" };
            StyleName styleNameToken = new StyleName() { Val = "Token" };


            StyleRunProperties styleRunPropertiesToken = new StyleRunProperties();
            Color colorToken = new Color() { Val = "0000FF" };
            Underline underlineToken = new Underline() { Val = UnderlineValues.Single };

            styleRunPropertiesToken.Append(colorToken);
            styleRunPropertiesToken.Append(underlineToken);

            styleToken.Append(styleNameToken);
            styleToken.Append(styleRunPropertiesToken);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента table--------------------
            Style styleTable = new Style() { Type = StyleValues.Table, StyleId = "Table" };
            StyleName styleNameTable = new StyleName() { Val = "Table" };

            StyleTableProperties styleTablePropertiesTable = new StyleTableProperties();

            TableBorders tableBordersTable = new TableBorders();
            TopBorder topBorderTable = new TopBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
            LeftBorder leftBorderTable = new LeftBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
            BottomBorder bottomBorderTable = new BottomBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
            RightBorder rightBorderTable = new RightBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
            InsideHorizontalBorder insideHorizontalBorderTable = new InsideHorizontalBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)0U };
            InsideVerticalBorder insideVerticalBorderTable = new InsideVerticalBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)0U };

            tableBordersTable.Append(topBorderTable);
            tableBordersTable.Append(leftBorderTable);
            tableBordersTable.Append(bottomBorderTable);
            tableBordersTable.Append(rightBorderTable);
            tableBordersTable.Append(insideHorizontalBorderTable);
            tableBordersTable.Append(insideVerticalBorderTable);

            TableCellMarginDefault tableCellMarginDefaultTable = new TableCellMarginDefault();
            TopMargin topMarginTable = new TopMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
            TableCellLeftMargin tableCellLeftMarginTable = new TableCellLeftMargin() { Width = 100, Type = TableWidthValues.Dxa };
            BottomMargin bottomMarginTable = new BottomMargin() { Width = "0", Type = TableWidthUnitValues.Dxa };
            TableCellRightMargin tableCellRightMarginTable = new TableCellRightMargin() { Width = 100, Type = TableWidthValues.Dxa };

            tableCellMarginDefaultTable.Append(topMarginTable);
            tableCellMarginDefaultTable.Append(tableCellLeftMarginTable);
            tableCellMarginDefaultTable.Append(bottomMarginTable);
            tableCellMarginDefaultTable.Append(tableCellRightMarginTable);

            styleTablePropertiesTable.Append(tableBordersTable);
            styleTablePropertiesTable.Append(tableCellMarginDefaultTable);

            styleTable.Append(styleNameTable);
            styleTable.Append(styleTablePropertiesTable);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента application--------------------
            Style styleApplication = new Style() { Type = StyleValues.Character, StyleId = "Application" };
            StyleName styleNameApplication = new StyleName() { Val = "Application" };


            StyleRunProperties styleRunPropertiesApplication = new StyleRunProperties();
            Bold boldApplication = new Bold();
            BoldComplexScript boldComplexScriptApplication = new BoldComplexScript();

            styleRunPropertiesApplication.Append(boldApplication);
            styleRunPropertiesApplication.Append(boldComplexScriptApplication);

            styleApplication.Append(styleNameApplication);
            styleApplication.Append(styleRunPropertiesApplication);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента codeInline--------------------
            Style styleCodeInline = new Style() { Type = StyleValues.Character, StyleId = "CodeInline" };
            StyleName styleNameCodeInline = new StyleName() { Val = "CodeInline" };


            StyleRunProperties styleRunPropertiesCodeInline = new StyleRunProperties();
            RunFonts runFontsCodeInline = new RunFonts() { Ascii = "Courier New", HighAnsi = "Courier New", ComplexScript = "Courier New" };

            styleRunPropertiesCodeInline.Append(runFontsCodeInline);

            styleCodeInline.Append(styleNameCodeInline);
            styleCodeInline.Append(styleRunPropertiesCodeInline);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента command--------------------
            Style styleCommand = new Style() { Type = StyleValues.Character, StyleId = "Command" };
            StyleName styleNameCommand = new StyleName() { Val = "Command" };


            StyleRunProperties styleRunPropertiesCommand = new StyleRunProperties();
            Bold boldCommand = new Bold();
            BoldComplexScript boldComplexScriptCommand = new BoldComplexScript();

            styleRunPropertiesCommand.Append(boldCommand);
            styleRunPropertiesCommand.Append(boldComplexScriptCommand);

            styleCommand.Append(styleNameCommand);
            styleCommand.Append(styleRunPropertiesCommand);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента codeInline--------------------
            Style styleComputerOutputInline = new Style() { Type = StyleValues.Character, StyleId = "ComputerOutputInline" };
            StyleName styleNameComputerOutputInline = new StyleName() { Val = "CodeInline" };


            StyleRunProperties styleRunPropertiesComputerOutputInline = new StyleRunProperties();
            RunFonts runFontsComputerOutputInline = new RunFonts() { Ascii = "Courier New", HighAnsi = "Courier New", ComplexScript = "Courier New" };

            styleRunPropertiesComputerOutputInline.Append(runFontsComputerOutputInline);

            styleComputerOutputInline.Append(styleNameComputerOutputInline);
            styleComputerOutputInline.Append(styleRunPropertiesComputerOutputInline);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента database--------------------
            Style styleDatabase = new Style() { Type = StyleValues.Character, StyleId = "Database" };
            StyleName styleNameDatabase = new StyleName() { Val = "Database" };


            StyleRunProperties styleRunPropertiesDatabase = new StyleRunProperties();
            Bold boldDatabase = new Bold();
            BoldComplexScript boldComplexScriptDatabase = new BoldComplexScript();

            styleRunPropertiesDatabase.Append(boldDatabase);
            styleRunPropertiesDatabase.Append(boldComplexScriptDatabase);

            styleDatabase.Append(styleNameDatabase);
            styleDatabase.Append(styleRunPropertiesDatabase);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента EnvironmentVariable--------------------
            Style styleEnvironmentVariable = new Style() { Type = StyleValues.Character, StyleId = "EnvironmentVariable" };
            StyleName styleNameEnvironmentVariable = new StyleName() { Val = "EnvironmentVariable" };


            StyleRunProperties styleRunPropertiesEnvironmentVariable = new StyleRunProperties();
            Color colorNameEnvironmentVariable = new Color() { Val = "376092" };

            styleRunPropertiesEnvironmentVariable.Append(colorNameEnvironmentVariable);

            styleEnvironmentVariable.Append(styleNameEnvironmentVariable);
            styleEnvironmentVariable.Append(styleRunPropertiesEnvironmentVariable);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента ErrorInline--------------------
            Style styleErrorInline = new Style() { Type = StyleValues.Character, StyleId = "ErrorInline" };
            StyleName styleNameErrorInline = new StyleName() { Val = "ErrorInline" };


            StyleRunProperties styleRunPropertiesErrorInline = new StyleRunProperties();
            Color colorNameErrorInline = new Color() { Val = "FF0000" };

            styleRunPropertiesErrorInline.Append(colorNameErrorInline);

            styleErrorInline.Append(styleNameErrorInline);
            styleErrorInline.Append(styleRunPropertiesErrorInline);
            //---------------------------------------------------------------------------



            //--------------------Определение стиля для элемента FictitiousUri--------------------
            Style styleFictitiousUri = new Style() { Type = StyleValues.Character, StyleId = "FictitiousUri" };
            StyleName styleNameFictitiousUri = new StyleName() { Val = "FictitiousUri" };


            StyleRunProperties styleRunPropertiesFictitiousUri = new StyleRunProperties();
            Color colorNameFictitiousUri = new Color() { Val = "C0504D" };
            Bold boldFictitiousUri = new Bold();
            BoldComplexScript boldComplexScriptFictitiousUri = new BoldComplexScript();
            SmallCaps smallCapsFictitiousUri = new SmallCaps();
            Spacing spacingFictitiousUri = new Spacing() { Val = 5 };
            Underline underlineFictitiousUri = new Underline() { Val = UnderlineValues.Single };

            styleRunPropertiesFictitiousUri.Append(colorNameFictitiousUri);
            styleRunPropertiesFictitiousUri.Append(boldFictitiousUri);
            styleRunPropertiesFictitiousUri.Append(boldComplexScriptFictitiousUri);
            styleRunPropertiesFictitiousUri.Append(smallCapsFictitiousUri);
            styleRunPropertiesFictitiousUri.Append(spacingFictitiousUri);
            styleRunPropertiesFictitiousUri.Append(underlineFictitiousUri);

            styleFictitiousUri.Append(styleNameFictitiousUri);
            styleFictitiousUri.Append(styleRunPropertiesFictitiousUri);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента ForeignPhrase--------------------
            Style styleForeignPhrase = new Style() { Type = StyleValues.Character, StyleId = "ForeignPhrase" };
            StyleName styleNameForeignPhrase = new StyleName() { Val = "ForeignPhrase" };


            StyleRunProperties styleRunPropertiesForeignPhrase = new StyleRunProperties();
            Italic italicForeignPhrase = new Italic();
            ItalicComplexScript italicComplexScriptForeignPhrase = new ItalicComplexScript();

            styleRunPropertiesForeignPhrase.Append(italicForeignPhrase);
            styleRunPropertiesForeignPhrase.Append(italicComplexScriptForeignPhrase);

            styleForeignPhrase.Append(styleNameForeignPhrase);
            styleForeignPhrase.Append(styleRunPropertiesForeignPhrase);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента Hardware--------------------
            Style styleHardware = new Style() { Type = StyleValues.Character, StyleId = "Hardware" };
            StyleName styleNameHardware = new StyleName() { Val = "Hardware" };


            StyleRunProperties styleRunPropertiesHardware = new StyleRunProperties();
            Bold boldHardware = new Bold();
            BoldComplexScript boldComplexScriptHardware = new BoldComplexScript();

            styleRunPropertiesHardware.Append(boldHardware);
            styleRunPropertiesHardware.Append(boldComplexScriptHardware);

            styleHardware.Append(styleNameHardware);
            styleHardware.Append(styleRunPropertiesHardware);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента LegacyBold--------------------
            Style styleLegacyBold = new Style() { Type = StyleValues.Character, StyleId = "LegacyBold" };
            StyleName styleNameLegacyBold = new StyleName() { Val = "LegacyBold" };


            StyleRunProperties styleRunPropertiesLegacyBold = new StyleRunProperties();
            Bold boldLegacyBold = new Bold();
            BoldComplexScript boldComplexScriptLegacyBold = new BoldComplexScript();

            styleRunPropertiesLegacyBold.Append(boldLegacyBold);
            styleRunPropertiesLegacyBold.Append(boldComplexScriptLegacyBold);

            styleLegacyBold.Append(styleNameLegacyBold);
            styleLegacyBold.Append(styleRunPropertiesLegacyBold);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента LegacyItalic--------------------
            Style styleLegacyItalic = new Style() { Type = StyleValues.Character, StyleId = "LegacyItalic" };
            StyleName styleNameLegacyItalic = new StyleName() { Val = "LegacyItalic" };


            StyleRunProperties styleRunPropertiesLegacyItalic = new StyleRunProperties();
            Italic italicLegacyItalic = new Italic();
            ItalicComplexScript italicComplexScriptLegacyItalic = new ItalicComplexScript();

            styleRunPropertiesLegacyItalic.Append(italicLegacyItalic);
            styleRunPropertiesLegacyItalic.Append(italicComplexScriptLegacyItalic);

            styleLegacyItalic.Append(styleNameLegacyItalic);
            styleLegacyItalic.Append(styleRunPropertiesLegacyItalic);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента LegacyUnderline--------------------
            Style styleLegacyUnderline = new Style() { Type = StyleValues.Character, StyleId = "LegacyUnderline" };
            StyleName styleNameLegacyUnderline = new StyleName() { Val = "LegacyUnderline" };


            StyleRunProperties styleRunPropertiesLegacyUnderline = new StyleRunProperties();
            Underline italicLegacyUnderline = new Underline();

            styleRunPropertiesLegacyUnderline.Append(italicLegacyUnderline);

            styleLegacyUnderline.Append(styleNameLegacyUnderline);
            styleLegacyUnderline.Append(styleRunPropertiesLegacyUnderline);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента Literal--------------------
            Style styleLiteral = new Style() { Type = StyleValues.Character, StyleId = "Literal" };
            StyleName styleNameLiteral = new StyleName() { Val = "Literal" };


            StyleRunProperties styleRunPropertiesLiteral = new StyleRunProperties();
            Color colorNameLiteral = new Color() { Val = "92D050" };

            styleRunPropertiesLiteral.Append(colorNameLiteral);

            styleLiteral.Append(styleNameLiteral);
            styleLiteral.Append(styleRunPropertiesLiteral);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента LocalUri--------------------
            Style styleLocalUri = new Style() { Type = StyleValues.Character, StyleId = "LocalUri" };
            StyleName styleNameLocalUri = new StyleName() { Val = "LocalUri" };


            StyleRunProperties styleRunPropertiesLocalUri = new StyleRunProperties();
            RunFonts runFontsLocalUri = new RunFonts() { Ascii = "Courier New", HighAnsi = "Courier New", ComplexScript = "Courier New" };
            Bold boldLocalUri = new Bold();
            BoldComplexScript boldComplexScriptLocalUri = new BoldComplexScript();

            styleRunPropertiesLocalUri.Append(runFontsLocalUri);
            styleRunPropertiesLocalUri.Append(boldLocalUri);
            styleRunPropertiesLocalUri.Append(boldComplexScriptLocalUri);

            styleLocalUri.Append(styleNameLocalUri);
            styleLocalUri.Append(styleRunPropertiesLocalUri);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента Math--------------------
            Style styleMath = new Style() { Type = StyleValues.Character, StyleId = "Math" };
            StyleName styleNameMath = new StyleName() { Val = "Math" };


            StyleRunProperties styleRunPropertiesMath = new StyleRunProperties();
            Italic italicMath = new Italic();
            ItalicComplexScript italicComplexScriptMath = new ItalicComplexScript();

            styleRunPropertiesMath.Append(italicMath);
            styleRunPropertiesMath.Append(italicComplexScriptMath);

            styleMath.Append(styleNameMath);
            styleMath.Append(styleRunPropertiesMath);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента NewTerm--------------------
            Style styleNewTerm = new Style() { Type = StyleValues.Character, StyleId = "NewTerm" };
            StyleName styleNameNewTerm = new StyleName() { Val = "NewTerm" };


            StyleRunProperties styleRunPropertiesNewTerm = new StyleRunProperties();
            Italic italicNewTerm = new Italic();
            ItalicComplexScript italicComplexScriptNewTerm = new ItalicComplexScript();

            styleRunPropertiesNewTerm.Append(italicNewTerm);
            styleRunPropertiesNewTerm.Append(italicComplexScriptNewTerm);

            styleNewTerm.Append(styleNameNewTerm);
            styleNewTerm.Append(styleRunPropertiesNewTerm);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента Phrase--------------------
            Style stylePhrase = new Style() { Type = StyleValues.Character, StyleId = "Phrase" };
            StyleName styleNamePhrase = new StyleName() { Val = "Phrase" };


            StyleRunProperties styleRunPropertiesPhrase = new StyleRunProperties();
            Italic italicPhrase = new Italic();
            ItalicComplexScript italicComplexScriptPhrase = new ItalicComplexScript();

            styleRunPropertiesPhrase.Append(italicPhrase);
            styleRunPropertiesPhrase.Append(italicComplexScriptPhrase);

            stylePhrase.Append(styleNamePhrase);
            stylePhrase.Append(styleRunPropertiesPhrase);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента Placeholder--------------------
            Style stylePlaceholder = new Style() { Type = StyleValues.Character, StyleId = "Placeholder" };
            StyleName styleNamePlaceholder = new StyleName() { Val = "Placeholder" };


            StyleRunProperties styleRunPropertiesPlaceholder = new StyleRunProperties();
            Italic italicPlaceholder = new Italic();
            ItalicComplexScript italicComplexScriptPlaceholder = new ItalicComplexScript();

            styleRunPropertiesPlaceholder.Append(italicPlaceholder);
            styleRunPropertiesPlaceholder.Append(italicComplexScriptPlaceholder);

            stylePlaceholder.Append(styleNamePlaceholder);
            stylePlaceholder.Append(styleRunPropertiesPlaceholder);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента QuoteInline--------------------
            Style styleQuoteInline = new Style() { Type = StyleValues.Character, StyleId = "QuoteInline" };
            StyleName styleNameQuoteInline = new StyleName() { Val = "QuoteInline" };


            StyleRunProperties styleRunPropertiesQuoteInline = new StyleRunProperties();
            Italic italicQuoteInline = new Italic();
            ItalicComplexScript italicComplexScriptQuoteInline = new ItalicComplexScript();

            styleRunPropertiesQuoteInline.Append(italicQuoteInline);
            styleRunPropertiesQuoteInline.Append(italicComplexScriptQuoteInline);

            styleQuoteInline.Append(styleNameQuoteInline);
            styleQuoteInline.Append(styleRunPropertiesQuoteInline);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента Replaceable--------------------
            Style styleReplaceable = new Style() { Type = StyleValues.Character, StyleId = "Replaceable" };
            StyleName styleNameReplaceable = new StyleName() { Val = "Replaceable" };


            StyleRunProperties styleRunPropertiesReplaceable = new StyleRunProperties();
            Italic italicReplaceable = new Italic();
            ItalicComplexScript italicComplexScriptReplaceable = new ItalicComplexScript();

            styleRunPropertiesReplaceable.Append(italicReplaceable);
            styleRunPropertiesReplaceable.Append(italicComplexScriptReplaceable);

            styleReplaceable.Append(styleNameReplaceable);
            styleReplaceable.Append(styleRunPropertiesReplaceable);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента System--------------------
            Style styleSystem = new Style() { Type = StyleValues.Character, StyleId = "System" };
            StyleName styleNameSystem = new StyleName() { Val = "System" };


            StyleRunProperties styleRunPropertiesSystem = new StyleRunProperties();
            Bold boldSystem = new Bold();
            BoldComplexScript boldComplexScriptSystem = new BoldComplexScript();

            styleRunPropertiesSystem.Append(boldSystem);
            styleRunPropertiesSystem.Append(boldComplexScriptSystem);

            styleSystem.Append(styleNameSystem);
            styleSystem.Append(styleRunPropertiesSystem);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента Ui--------------------
            Style styleUi = new Style() { Type = StyleValues.Character, StyleId = "Ui" };
            StyleName styleNameUi = new StyleName() { Val = "Ui" };


            StyleRunProperties styleRunPropertiesUi = new StyleRunProperties();
            Bold boldUi = new Bold();
            BoldComplexScript boldComplexScriptUi = new BoldComplexScript();

            styleRunPropertiesUi.Append(boldUi);
            styleRunPropertiesUi.Append(boldComplexScriptUi);

            styleUi.Append(styleNameUi);
            styleUi.Append(styleRunPropertiesUi);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента UnmanagedCodeEntityReference--------------------
            Style styleUnmanagedCodeEntityReference = new Style() { Type = StyleValues.Character, StyleId = "UnmanagedCodeEntityReference" };
            StyleName styleNameUnmanagedCodeEntityReference = new StyleName() { Val = "UnmanagedCodeEntityReference" };


            StyleRunProperties styleRunPropertiesUnmanagedCodeEntityReference = new StyleRunProperties();
            Bold boldUnmanagedCodeEntityReference = new Bold();
            BoldComplexScript boldComplexScriptUnmanagedCodeEntityReference = new BoldComplexScript();

            styleRunPropertiesUnmanagedCodeEntityReference.Append(boldUnmanagedCodeEntityReference);
            styleRunPropertiesUnmanagedCodeEntityReference.Append(boldComplexScriptUnmanagedCodeEntityReference);

            styleUnmanagedCodeEntityReference.Append(styleNameUnmanagedCodeEntityReference);
            styleUnmanagedCodeEntityReference.Append(styleRunPropertiesUnmanagedCodeEntityReference);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента UserInput--------------------
            Style styleUserInput = new Style() { Type = StyleValues.Character, StyleId = "UserInput" };
            StyleName styleNameUserInput = new StyleName() { Val = "UserInput" };


            StyleRunProperties styleRunPropertiesUserInput = new StyleRunProperties();
            Bold boldUserInput = new Bold();
            BoldComplexScript boldComplexScriptUserInput = new BoldComplexScript();

            styleRunPropertiesUserInput.Append(boldUserInput);
            styleRunPropertiesUserInput.Append(boldComplexScriptUserInput);

            styleUserInput.Append(styleNameUserInput);
            styleUserInput.Append(styleRunPropertiesUserInput);
            //---------------------------------------------------------------------------


            //--------------------Определение стиля для элемента CodeTitle--------------------
            Style styleCodeTitle = new Style() { Type = StyleValues.Paragraph, StyleId = "CodeTitle" };
            StyleName styleNameCodeTitle = new StyleName() { Val = "CodeTitle" };


            StyleParagraphProperties styleParagraphPropertiesCodeTitle = new StyleParagraphProperties();
            SpacingBetweenLines spacingBetweenLinesCodeTitle = new SpacingBetweenLines() { Before = "100", After = "30" };
            styleParagraphPropertiesCodeTitle.Append(spacingBetweenLinesCodeTitle);


            StyleRunProperties styleRunPropertiesCodeTitle = new StyleRunProperties();
            RunFonts runFontsCodeTitle = new RunFonts() { AsciiTheme = ThemeFontValues.MajorHighAnsi, HighAnsiTheme = ThemeFontValues.MajorHighAnsi, EastAsiaTheme = ThemeFontValues.MajorEastAsia, ComplexScriptTheme = ThemeFontValues.MajorBidi };
            Bold boldCodeTitle = new Bold();
            BoldComplexScript boldComplexScriptCodeTitle = new BoldComplexScript();
            Color colorCodeTitle = new Color() { Val = "5F81BD" };
            FontSize fontSizeCodeTitle = new FontSize() { Val = "20" };
            FontSizeComplexScript fontSizeComplexScriptCodeTitle = new FontSizeComplexScript() { Val = "20" };

            styleRunPropertiesCodeTitle.Append(runFontsCodeTitle);
            styleRunPropertiesCodeTitle.Append(boldCodeTitle);
            styleRunPropertiesCodeTitle.Append(boldComplexScriptCodeTitle);
            styleRunPropertiesCodeTitle.Append(colorCodeTitle);
            styleRunPropertiesCodeTitle.Append(fontSizeCodeTitle);
            styleRunPropertiesCodeTitle.Append(fontSizeComplexScriptCodeTitle);

            styleCodeTitle.Append(styleNameCodeTitle);
            styleCodeTitle.Append(styleParagraphPropertiesCodeTitle);
            styleCodeTitle.Append(styleRunPropertiesCodeTitle);
            //---------------------------------------------------------------------------

            styles.Append(docDefaults);
            styles.Append(styleCode);
            styles.Append(styleAlert);
            styles.Append(styleQuote);
            styles.Append(styleNameTopic);
            styles.Append(styleTitle);
            styles.Append(styleToken);
            styles.Append(styleApplication);
            styles.Append(styleCodeInline);
            styles.Append(styleCommand);
            styles.Append(styleComputerOutputInline);
            styles.Append(styleDatabase);
            styles.Append(styleEnvironmentVariable);
            styles.Append(styleErrorInline);
            styles.Append(styleFictitiousUri);
            styles.Append(styleForeignPhrase);
            styles.Append(styleHardware);
            styles.Append(styleLegacyBold);
            styles.Append(styleLegacyItalic);
            styles.Append(styleLegacyUnderline);
            styles.Append(styleLiteral);
            styles.Append(styleLocalUri);
            styles.Append(styleMath);
            styles.Append(styleNewTerm);
            styles.Append(stylePhrase);
            styles.Append(stylePlaceholder);
            styles.Append(styleQuoteInline);
            styles.Append(styleReplaceable);
            styles.Append(styleSystem);
            styles.Append(styleUi);
            styles.Append(styleUnmanagedCodeEntityReference);
            styles.Append(styleUserInput);
            styles.Append(styleCodeTitle);
            styles.Append(styleGlossaryTerm);
            styles.Append(styleTable);

            styleDefinitionsPart.Styles = styles;
        }
    }
}
